﻿<%@ Page Title="Listado de Descuentos" Language="C#" MasterPageFile="~/MasterPage/Master.Master"
    AutoEventWireup="true" CodeBehind="wFrmDescuentos.aspx.cs" Inherits="Crosland.Automotriz.Web.Repuestos.wFrmDescuentos" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx1" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
    <script type="text/javascript">
        function MostrarAlerta() {
            popupErrores.Show();
        }
    </script>
    <div class="main-header" style="width: 100%;">
        <div class="main-titulo" style="text-align: left">
            Listado de Ofertas</div>
    </div>
    <div style="padding: 10px">
        <table width="100%">
            <tr>
                <td class="filas2"  style="width: 105px">
                    <dx:ASPxButton ID="btnNuevo" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" OnClick="btnNuevo_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="Nuevo" Width="100px">
                        <Image Url="~/Images/bt_new_button.gif">
                        </Image>
                    </dx:ASPxButton>
                </td>
                <td class="filas2"  style="width: 105px">
                    <dx:ASPxButton ID="btnModificar" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" OnClick="btnModificar_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="Modificar">
                        <Image Url="~/Images/edit2.gif">
                        </Image>
                    </dx:ASPxButton>
                </td>
                <td class="filas2"  style="width: 155px">
                    <dx:ASPxButton ID="btnEnviarSolicitud" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="Enviar Solicitud" Width="150px" OnClick="btnEnviarSolicitud_Click">
                        <Image Url="~/Images/landscape.gif">
                        </Image>
                    </dx:ASPxButton>
                </td>
                <td class="filas2"  style="width: 105px">
                    <dx:ASPxButton ID="btnAnular" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="Anular" Width="100px" OnClick="btnAnular_Click">
                        <ClientSideEvents Click="function(s, e) {
	e.processOnServer = confirm('¿Desea anular la oferta?');
}" />
                        <Image Url="~/Images/delete.png">
                        </Image>
                    </dx:ASPxButton>
                </td>
                <td class="filas2" >
                    <dx:ASPxButton ID="btnSalir" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="Salir" Width="100px" OnClick="btnSalir_Click">
                        <Image Url="~/Images/logout.png">
                        </Image>
                    </dx:ASPxButton>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <hr />
                </td>
            </tr>
        </table>
        <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
            CssPostfix="Office2010Blue" EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px"
            GroupBoxCaptionOffsetY="-19px" HeaderText="" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
            Width="100%">
            <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                    <table width="100%" style="width: 100%">
                        <tr>
                            <td style="width: 83px">
                                <asp:Label ID="Label1" runat="server" Text="Organización:"></asp:Label>
                            </td>
                            <td style="width: 155px">
                                <dx:ASPxComboBox ID="cboOrganizacion" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Width="150px" AutoPostBack="True" OnSelectedIndexChanged="cboOrganizacion_SelectedIndexChanged"
                                    Height="30px">
                                    <ItemStyle Height="30px" />
                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="5px">
                                    </LoadingPanelStyle>
                                    <DropDownButton Width="20px">
                                    </DropDownButton>
                                    <ButtonStyle Width="13px">
                                    </ButtonStyle>
                                    <Paddings PaddingLeft="5px" />
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 109px">
                                <asp:Label ID="Label2" runat="server" Text="Oficina:"></asp:Label>
                            </td>
                            <td style="width: 155px">
                                <dx:ASPxComboBox ID="cboOficina" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" Height="30px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Width="150px">
                                    <ItemStyle Height="30px" />
                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="5px">
                                    </LoadingPanelStyle>
                                    <DropDownButton Width="20px">
                                    </DropDownButton>
                                    <ButtonStyle Width="13px">
                                    </ButtonStyle>
                                    <Paddings PaddingLeft="5px" />
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 48px">
                                <asp:Label ID="Label3" runat="server" Text="Canal:"></asp:Label>
                            </td>
                            <td width="200">
                                <dx:ASPxComboBox ID="cboCanal" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" Height="30px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Width="195px">
                                    <ItemStyle Height="30px" />
                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="5px">
                                    </LoadingPanelStyle>
                                    <DropDownButton Width="20px">
                                    </DropDownButton>
                                    <ButtonStyle Width="13px">
                                    </ButtonStyle>
                                    <Paddings PaddingLeft="5px" />
                                </dx:ASPxComboBox>
                            </td>
                            <td>
                                <dx:ASPxButton ID="btnConsultar" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" OnClick="btnConsultar_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Text="Consultar" Width="108px" Height="26px">
                                    <Image Url="~/Images/search.png">
                                    </Image>
                                </dx:ASPxButton>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 83px">
                                <asp:Label ID="Label12" runat="server" Text="Estado:"></asp:Label>
                            </td>
                            <td style="width: 155px">
                                <dx:ASPxComboBox ID="cboEstado" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" Height="30px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Width="150px">
                                    <ItemStyle Height="30px" />
                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="5px">
                                    </LoadingPanelStyle>
                                    <DropDownButton Width="20px">
                                    </DropDownButton>
                                    <ButtonStyle Width="13px">
                                    </ButtonStyle>
                                    <Paddings PaddingLeft="5px" />
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 109px">
                                <asp:Label ID="Label4" runat="server" Text="Tipo Oferta:"></asp:Label>
                            </td>
                            <td style="width: 155px">
                                <dx:ASPxComboBox ID="cboTipoDescuento" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" Height="30px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Width="150px">
                                    <ItemStyle Height="30px" />
                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="5px">
                                    </LoadingPanelStyle>
                                    <DropDownButton Width="20px">
                                    </DropDownButton>
                                    <ButtonStyle Width="13px">
                                    </ButtonStyle>
                                    <Paddings PaddingLeft="5px" />
                                </dx:ASPxComboBox>
                            </td>
                            <td colspan="2">
                                <asp:CheckBox ID="chkActivas" runat="server" Checked="True" Text="Ver Ofertas Activas" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <dx:ASPxGridView ID="gvListado" runat="server" Caption="Listado de Ofertas" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
            CssPostfix="Office2010Blue" Width="100%" AutoGenerateColumns="False" KeyFieldName="ID_VEN_OFERTA_CAB">
            <Columns>
                <dx:GridViewDataTextColumn Caption="Organización" FieldName="DES_ORG_VTA" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Oficina" FieldName="DES_OFI_VTA" VisibleIndex="2">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Canal" FieldName="DES_CANAL_DISTRIB" VisibleIndex="3">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Tipo de Oferta" FieldName="TIPO_DESCUENTO" VisibleIndex="4">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Fecha Inicial" FieldName="FEC_INICIO" VisibleIndex="5"
                    Width="100px">
                    <PropertiesTextEdit DisplayFormatString="dd/MM/yyyy">
                    </PropertiesTextEdit>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Fecha Final" FieldName="FEC_FIN" VisibleIndex="6"
                    Width="100px">
                    <PropertiesTextEdit DisplayFormatString="dd/MM/yyyy">
                    </PropertiesTextEdit>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Nro. Oferta" FieldName="ID_VEN_OFERTA_CAB" VisibleIndex="0"
                    Width="50px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Estado" FieldName="ESTADO" VisibleIndex="7">
                </dx:GridViewDataTextColumn>
            </Columns>
            <SettingsBehavior AllowFocusedRow="True" AllowSelectByRowClick="True" AllowSelectSingleRowOnly="True"
                AllowDragDrop="False" AllowGroup="False" AllowSort="False" />
            <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesPager>
                <PageNumber ForeColor="#3E4846">
                </PageNumber>
                <Summary ForeColor="#1E395B">
                </Summary>
            </StylesPager>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
        </dx:ASPxGridView>
    </div>
    <dx:ASPxPopupControl ID="pcSolicitud" runat="server" AllowDragging="True" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
        CssPostfix="Office2010Blue" EnableHotTrack="False" HeaderText="Enviar Solicitud"
        Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Width="500px">
        <HeaderImage Url="~/Images/landscape.gif">
        </HeaderImage>
        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
        </LoadingPanelImage>
        <HeaderStyle>
            <Paddings PaddingLeft="7px" />
        </HeaderStyle>
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                <table width="100%">
                    <tr>
                        <td class="filas2" >
                            <asp:Label ID="Label10" runat="server" Font-Bold="True" Text="Para:"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="filas2" >
                            <dx:ASPxComboBox ID="cboUsuarios" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" Height="30px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                Width="300px">
                                <ItemStyle Height="30px" />
                                <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                </LoadingPanelImage>
                                <LoadingPanelStyle ImageSpacing="5px">
                                </LoadingPanelStyle>
                                <DropDownButton Width="20px">
                                </DropDownButton>
                                <Paddings PaddingLeft="5px" />
                            </dx:ASPxComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="filas2" >
                            <asp:Label ID="Label11" runat="server" Font-Bold="True" Text="CC:"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="filas2" >
                            <dx:ASPxTextBox ID="txtCC" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" Height="30px" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                Width="300px">
                                <Paddings PaddingLeft="5px" />
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="filas2" >
                            <asp:Label ID="Label9" runat="server" Font-Bold="True" Text="Observaciones:"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="filas2" >
                            <dx:ASPxMemo ID="txtObservacion" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" Height="100px" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                Width="500px">
                            </dx:ASPxMemo>
                        </td>
                    </tr>
                    <tr>
                        <td class="filas2" >
                            <dx:ASPxButton ID="btnGrabarSolicitud" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                Text="Enviar" OnClick="btnGrabarSolicitud_Click">
                                <ClientSideEvents Click="function(s, e) {
	e.processOnServer = confirm('¿Seguro de enviar la solicitud?');
}" />
                                <Image Url="~/Images/email2.png">
                                </Image>
                            </dx:ASPxButton>
                        </td>
                    </tr>
                </table>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
    <dx:ASPxPopupControl ID="popupErrores" runat="server" AllowDragging="True" ClientInstanceName="popupErrores"
        CloseAction="CloseButton" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
        CssPostfix="Office2010Blue" EnableViewState="False" HeaderText="Mensaje" Modal="True"
        PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
        Width="300px" EnableHotTrack="False">
        <HeaderImage Url="~/Images/icon_message.png">
        </HeaderImage>
        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
        </LoadingPanelImage>
        <HeaderStyle>
            <Paddings PaddingLeft="7px" />
        </HeaderStyle>
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">
                <br />
                <dx:ASPxPanel ID="ASPxPanel3" runat="server" DefaultButton="btCreate">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent2" runat="server">
                            <table width="100%">
                                <tr>
                                    <td class="filas2"  align="center" valign="middle">
                                        <asp:Label ID="lblMensaje" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="filas2"  align="center">
                                        <dx:ASPxButton ID="ASPxButton6" runat="server" AutoPostBack="False" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Text="Aceptar" Width="10px">
                                            <ClientSideEvents Click="function(s, e) {
	popupErrores.Hide();
}" />
                                            <Image Url="~/Images/ok.png">
                                            </Image>
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxPanel>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
</asp:Content>
